-
-
Notifications
You must be signed in to change notification settings - Fork 80
pbio/sys/light: stop animation when drawing on screen #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
de60cbc to
35f23d9
Compare
Stop the "running" animation on the first drawing to the screen, and clear screen when the user program exits. Refs: pybricks/support#2154
35f23d9 to
5ac584c
Compare
|
Thank you! I've been working on some refactoring lately that is somewhat related. We have a similar aspect for the animation of the hub light on Technic/City/Move Hub. This is actually an animation that runs in user space, much like any other user animation, so doesn't really belong in The light matrix animation in SPIKE is somewhat similar, and by extension, a display animation for EV3 might be as well. I'll merge the code for the button light animation shortly, and then I'll have a look as to how it applies for the display. Once we do that, we are free to make other animations if we want to, not restricted to the 5x5 grid. |
|
I had the same feeling about The idea is to have the animation and screen control at the same place that the user program start/stop handling. Depending on your refactoring work landing time, would you mind merging anyway so it solves my problem until this is moved elsewhere? |
|
In the case of the LEDs, there is the complication that system error codes may override user light. I could see that possibly applying to the light matrix and display as well, but I don't suppose we need to make it that generic unless we really need it. So indeed the simpler way would be to have full user control while the user program is active, and have a possible animation start in user space. When the program ends, the UI regains control. |
Yes, we can do that 😄 |
|
At closer look, it looks like #382 is already heading in the right direction. There is a dedicated place that starts and stops the user animation for both the user light and light matrix. It is called when the program begins, rather than triggered by events about the program starting. Would it make sense to revisit and add your PR on top of that? |
|
And simplifying further... Considering that we only have the light matrix display so that we can have a UI for now, we can avoid this problem entirely by just not starting the animation in the first place and clearing the display when the program starts and ends. I've added a commit to #382. Tested by drawing on the screen from the user program. It is erased when the program ends, and a clean screen appears when the program begins. If that works well enough for you, we could close this PR. |
|
OK for me. |
Stop the "running" animation on the first drawing to the screen, and clear screen when the user program exits.
Refs: pybricks/support#2154
First proposal to get the ball rolling.